<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common-app/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>申请书编辑</title>
<script type="text/javascript" src="${res}/js/jquery/jquery.form.js"></script>
<script type="text/javascript" src="${res}/js/proposal/irisPrpPrepare.js"></script>
<script type="text/javascript" src="${res}/js/validate/irisvalidator.js"></script>
<script type="text/javascript" src="${res}/js/keyword/keywordtips.js"></script>
<script type="text/javascript" src="${res_app}/js/app/proposal/irisPrpPrepare.js"></script>
<script type="text/javascript">
	var ctxpath = "${ctx}";
	var prcWin = new progressWin("${res}");//初始化遮罩层
	$(document).ready(function() {
		queryflex();
		/**
		 * 申请书提交方法
		 */
		
		$("#wbox1").click(function() {
			check("check");
		});
		
		$("#wbox2").click(function() {
			check("check");
		});
		
		initControl();
		
		$("table").addClass("table01");
		$("table").not(".tab_btn").addClass("t_css");
		$("table.table01").each(function() {
			$(this).find("tr").not(".cbTable tr").filter(":even").addClass("li_1");
			$(this).find("tr").not(".cbTable tr").filter(":odd").addClass("li_2");
		});
		$("#checkbox_table_").removeClass("table01");
		/* 	$("#feaReport_upload1").removeClass("table01");
			$("#feaReport_upload2").removeClass("table01"); */
		$('div').find("[id^='checkbox_dyn_']").find("td").css("border", '0px solid');
		
		window.setInterval("checkPdfStatus()", "10000");//检验申请书的pdf
		
		/* fileInit("feaReport_upload1","PDF");
		fileInit("feaReport_upload2","PDF"); */
		fileInit("prpContent_upload", "PDF", null, "{'PDF':'51200'}");
		$("#prpContent_upload").find(".file").hide();//隐藏文本框
		
		$("#org").attr("disabled", "true");
		initDepartForComplete("org");
	});
	$(document).ready(function() {
		var nowDate = '${sercverSysDate1}';
		if ($("#apply_date_curr").val() == "") {
			$("#apply_date_curr").val(nowDate);
		}
	});
	/**
	 * 填写检查
	 */
	function check(type) {
		setTotalMoney();
		setIsFinanceSupport();
		/* validate($("#basic_info_jzfp"),"项目基本情况");
		validateByTabRow($("#tblorg_hzs"),"项目基本情况-->合作单位信息",0);
		validate($("#tblMileStones8"),"项目基本情况");
		($("#feaReport_upload1"),"项目概述和主要研究内容"); 
		if(checkNull()){
		validate($("#fundInfo_from"),"经费概算-->资金概算");
		    validate($("#fundInfo"),"经费概算-->资金概算");
		}
		validate($("#feaReport_upload2"),"合作情况和风险分析");  */
		/* prp_attach(); */
		if (!valResult()) {
			irisValShowMsg($("#wbox1"));
			return false;
		}
		if (type == "check") {
			showBox($("#wbox1"), "300px", "200px", "检查通过", "1:所有检查全部合格");
		}
		return true;
	}
	function setIsFinanceSupport() {
		var results_registration_form9_value = $("#results_registration_form9_value").val();
		if (results_registration_form9_value == '99') {
			$("#is_finance_support").val('N');
		} else {
			$("#is_finance_support").val('F');
		}
	}
	function setTotalMoney() {
		$('#request_amt').val($('#request_money').val());
	}
</script>

<style>
textarea {
	overflow: auto;
}
</style>
</head>
<body>
    <c:set var="xmlstr" value="${xmlData}" scope="request" />
    <x:parse xml="${xmlstr}" var="xmlData" scope="request" />
    <input type="hidden" id="childDiv" class="thickbox" />
    <input type="hidden" id="filePath" value="${ctx}/file/ajax-filedownload?fileCode=" />
    <input type="hidden" id="menuId" value="${param.menuId}" />
    <input type="hidden" id="sysDate" value="${sercverSysDate}" />
    <div id="showMessage"></div>
    <div id="content">
        <cpt:helpTips key="prpedit" id="prpEditTips"></cpt:helpTips>
        <div class="clear_h15"></div>
        <div class="word_box" id="mainDiv">

            <!-- 公用的配置界面 ：保存、提交等button-->
            <jsp:include page="./prpeditmain_public_kjcg_first.jsp"><jsp:param
                    value="${xmlstr}" name="xmlstr" /></jsp:include>

            <div class="bar_b">
                <input type="hidden" id="pdfStatus" value="${pdfStatus}" />
                <span class="right">版本号：<span name="proposal/prp_version" id="prp_version"><x:out
                            select="$xmlData/data/proposal/prp_version" /></span></span>
            </div>
            <form method="post" id="mainForm">
                <input type="hidden" value="${grantCode}" id="grantCode" name="grantCode">
                <input type="hidden" value="${posCode}" id="posCode" name="posCode">
                <input type="hidden" value="<iris:des3 code="${posCode}"></iris:des3>"
                    id="posCodeDes" name="posCodeDes">
                <input type="hidden" value="<iris:des3 code="${fbl.pdfCode}"></iris:des3>"
                    id="pdfCodeDes" name="pdfCodeDes">
                <input type="hidden" value="${xmlData}" id="xmlData" name="xmlData">
                <input type="hidden" value="${fbl.pdfCode}" id="pdfCode" name="pdfCode">
                <input type="hidden" value="${flag_shizhi}" id="flag_shizhi"
                    name="proposal/flag_shizhi">
            </form>
            <div class="word_title">
                <c:set var="statYear" scope="request">${statYear}</c:set>
                <c:if test="${empty statYear}">
                    <c:set var="statYear" scope="request">
                        <x:out select="$xmlData/data/proposal/stat_year" />
                    </c:set>
                </c:if>
                <input type="hidden" name="proposal/stat_year" value="${statYear}">

                <c:set var="sub">
                    <x:out select="$xmlData/data/proposal/sub_grant_code" />
                </c:set>

                <!-- 标题 -->
                <span name="proposal/grant_name"><x:out
                        select="$xmlData/data/proposal/grant_name" /></span>-科技成果 (${statYear }年)

                <input type="hidden" name="proposal/manage_category"
                    value="<x:out select="$xmlData/data/proposal/manage_category" />" />
                <input type="hidden" name="proposal/grant_code"
                    value="<x:out select="$xmlData/data/proposal/grant_code" />" />
                <input type="hidden" name="proposal/psn_code"
                    value="<x:out select="$xmlData/data/proposal/psn_code" />" />
                <input type="hidden" id="grant_no" name="proposal/grant_no"
                    value="<x:out select="$xmlData/data/proposal/grant_no" />" />
                <input type="hidden" name="proposal/sub_grant_code"
                    value="<x:out select="$xmlData/data/proposal/sub_grant_code" />" />
                <input name="proposal/register_area_code" type="hidden"
                    value="<x:out select="$xmlData/data/organizations/organization[@submit_org='1']/area_value" />" />
                <input name="proposal/register_area_name" type="hidden"
                    value="<x:out select="$xmlData/data/organizations/organization[@submit_org='1']/area_name" />" />
                <input type="hidden" id="sub_grant_no" name="proposal/sub_grant_no"
                    value="<x:out select="$xmlData/data/proposal/sub_grant_no" />" />
                <input type="hidden" name="proposal/help_grant_code"
                    value="<x:out select="$xmlData/data/proposal/help_grant_code" />" />
                <input type="hidden" id="help_grant_no" name="proposal/help_grant_no"
                    value="<x:out select="$xmlData/data/proposal/help_grant_no" />" />
                <c:set var="formCode">
                    <x:out select="$xmlData/data/proposal/form_code" />
                </c:set>
                <c:set var="nature_value">
                    <x:out
                        select="$xmlData/data/organizations/organization[@submit_org='1']/nature_value" />
                </c:set>
                <c:if test="${empty formCode}">
                    <c:set var="formCode" value="${param.formCode}"></c:set>
                </c:if>
                <input type="hidden" name="proposal/form_code" value="${formCode}" />
                <input type="hidden" name="proposal/request_amt" id="request_amt"
                    value="<x:out select="$xmlData/data/proposal/request_amt"/>">
                <input type="hidden" name="proposal/year" value="${year}" />
                <input type="hidden" name="organizations/organization/nature_value"
                    value="<x:out select="$xmlData/data/organizations/organization[@submit_org='1']/nature_value" />" />
                <input type="hidden" name="organization/whether_is_gaoxin_value"
                    value="<x:out select="$xmlData/data/organization/whether_is_gaoxin_value" />" />
                <input type="hidden" name="organization/whether_industrial_base_value"
                    value="<x:out select="$xmlData/data/organization/whether_industrial_base_value" />" />
                <input type="hidden" name="organization/whether_is_province_value"
                    value="<x:out select="$xmlData/data/organization/whether_is_province_value" />" />

                <!-- 成果登记表需要拆分字段  begin-->
                <!-- 财政资金支持 -->
                <input type="hidden" name="proposal/is_finance_support" id="is_finance_support"
                    value="<x:out select="$xmlData/data/proposal/is_finance_support" />" />
                <!-- 下达财政资金的部门 （01、02、03……）-->
                <input type="hidden" name="proposal/finance_support_dept_value" id="finance_support_dept_value"
                    value="<x:out select="$xmlData/data/proposal/finance_support_dept_value" />" />
                <!-- 成果完成单位类型 -->
                <input type="hidden" name="proposal/pay_offs_org_type" id="pay_offs_org_type"
                    value="<x:out select="$xmlData/data/proposal/pay_offs_org_type" />" />
                <!-- 成果登记表需要拆分字段  end-->

                <!-- 申请日期 -->
                <%-- <input type="hidden" id="submit_date" name="proposal/submit_date" value="<x:out select="$xmlData/data/proposal/submit_date" />" /> --%>

                <!-- 公用的配置界面 -->
                <jsp:include page="./prpeditmain_public.jsp"><jsp:param
                        value="${xmlstr}" name="xmlstr" /></jsp:include>
            </div>
            <div id="tabnav">
                <ul>

                    <li class="down" id="tab1" onclick="changeTab(this.id)">
                        <a href="###"><span>成果概况</span></a>
                    </li>
                    <li id="tab2" onclick="changeTab(this.id)">
                        <a href="###"><span>成果概况</span></a>
                    </li>
                    <li id="tab3" onclick="changeTab(this.id)">
                        <a href="###"><span>立项情况</span></a>
                    </li>
                    <li id="tab4" onclick="changeTab(this.id)">
                        <a href="###"><span>评价情况</span></a>
                    </li>
                    <li id="tab5" onclick="changeTab(this.id)">
                        <a href="###"><span>成果完成单位情况</span></a>
                    </li>
                    <li id="tab6" onclick="changeTab(this.id)">
                        <a href="###"><span>成果简介</span></a>
                    </li>
                    <li id="tab7" onclick="changeTab(this.id)">
                        <a href="###"><span>成果完成人员名单</span></a>
                    </li>
                    <li id="tab8" onclick="changeTab(this.id)">
                        <a href="###"><span>需提交的材料</span></a>
                    </li>
                </ul>
            </div>

            <!-- 填报说明 -->
            <div class="tab_box" id="fragment-tab1">
                <jsp:include page="../info/prpinfo_jcllorrkx_2017.jsp">
                    <jsp:param value="${xmlstr}" name="xmlstr" />
                    <jsp:param value="基础理论、软科学类科技成果填写说明" name="title" />
                </jsp:include>
            </div>
            <!-- 成果概况  -->
            <div class="tab_box" id="fragment-tab2" style="display: none">
                <jsp:include page="../goal/prpgoaledit_jcllorrkx_2017.jsp">
                    <jsp:param value="${xmlstr}" name="xmlstr" />
                </jsp:include>
            </div>
            <!-- 立项情况 -->
            <div class="tab_box" id="fragment-tab3" style="display: none">
                <jsp:include page="../goal/prpgoaledit_jcllorrkx1_2017.jsp">
                    <jsp:param value="${xmlstr}" name="xmlstr" />
                </jsp:include>
            </div>
            <!-- 评价情况 -->
            <div class="tab_box" id="fragment-tab4" style="display: none">
                <jsp:include page="../goal/prpgoaledit_jcllorrkx2_2017.jsp">
                    <jsp:param value="${xmlstr}" name="xmlstr" />
                </jsp:include>
            </div>
            <!-- 成果完成单位情况 -->
            <div class="tab_box" id="fragment-tab5" style="display: none">
                <jsp:include page="../goal/prpgoaledit_jcllorrkx3_2017.jsp">
                    <jsp:param value="${xmlstr}" name="xmlstr" />
                </jsp:include>
            </div>
            <!-- 成果简介 -->
            <div class="tab_box" id="fragment-tab6" style="display: none">
                <jsp:include page="../goal/prpgoaledit_jcllorrkx4_2017.jsp">
                    <jsp:param value="${xmlstr}" name="xmlstr" />
                </jsp:include>
            </div>
            <!-- 成果完成人员名单 -->
            <div class="tab_box" id="fragment-tab7" style="display: none">
                <jsp:include page="../goal/prpgoaledit_jcllorrkx5_2017.jsp">
                    <jsp:param value="${xmlstr}" name="xmlstr" />
                </jsp:include>
            </div>
            <!-- 附件 -->
            <div class="tab_box" id="fragment-tab8" style="display: none">
                <jsp:include page="../attach/prpAttachEdit_kjgg_2017.jsp">
                    <jsp:param value="${xmlstr}" name="xmlstr" />
                </jsp:include>
                <p style="font-size: 13px">
                    <strong>备注：</strong>
                </p>
                <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1、递交纸质材料时，提供系统打印的申请书纸质文件，一式两份，签字盖章后报送归口管理部门</p>
                <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2、递交纸质材料时，申报单位所在地归口管理部门校验以上附件材料</p>
            </div>

            <!-- 公用的配置界面 ：保存、提交等button -->
            <jsp:include page="./prpeditmain_public_kjcg_last.jsp"><jsp:param
                    value="${xmlstr}" name="xmlstr" /></jsp:include>
        </div>
        <div class="clear_h15"></div>
    </div>
</body>
</html>

